package com.async.designpatterns.create.builder;

import java.util.Date;

/**
 * 定义建造类，集成建造接口
 */
public class ConcreteBuilder implements IBuilder {
    private Product product = new Product();

    @Override
    public void initName() {
        product.setName("奥迪A8汽车2018新款");
    }

    @Override
    public void initTime() {
        product.setProductTime(new Date().toString());
    }

    @Override
    public void setCompany() {
        product.setProductCompany("一汽奥迪（中国）");
    }

    @Override
    public void setPrice() {
        product.setPrice("68.8W RMB");
    }

    @Override
    public void setType() {
        product.setUseType("汽车（交通/出行）");
    }

    @Override
    public Product create() {
        return product;
    }
}
